
package utserver;

import java.net.InetAddress;
import java.util.HashMap;
import java.util.Iterator;

public class User {
    
    private String name;
    private String passwd;
    private String tpasswd;
    private InetAddress ipAdres;
    private int port;
    private Long pingTime,positionX,positionY,hiz;  
    private String message;
    private Boolean isLoginAndo;
    private HashMap<Integer, String> arrayIzleyici = new HashMap<Integer, String>();
    private Long uyelikTarih;
    
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    
    public String getPasswd() {
        return passwd;
    }
    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }
    
    public String getTPasswd() {
        return tpasswd;
    }
    public void setTPasswd(String tpasswd) {
        this.tpasswd = tpasswd;
    }
    
    public InetAddress getIPAdres() {
        return ipAdres;
    }
    public void setIPAdres(InetAddress ipAdres) {
        this.ipAdres = ipAdres;
    }
    
    public int getPort() {
        return port;
    }
    public void setPort(int port) {
        this.port = port;
    }
    
    public Long getPingTime() {
        return pingTime;
    }
    public void setPingTime(Long pingTime) {
        this.pingTime = pingTime;
    }
    
    public Long getPositionX() {
        return positionX;
    }
    public void setPositionX(Long positionX) {
        this.positionX = positionX;
    }
    
    public Long getPositionY() {
        return positionY;
    }
    public void setPositionY(Long positionY) {
        this.positionY = positionY;
    }
    
    public Long getHiz() {
        return hiz;
    }
    public void setHiz(Long hiz) {
        this.hiz = hiz;
    }
        
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    
    public Boolean getisLoginAndo() {
        return isLoginAndo;
    }
    public void setisLoginAndo(Boolean isLogin) {
        this.isLoginAndo = isLogin;
    }
        
    public String addIzleyici(InetAddress adres, int port) {
        return arrayIzleyici.put( ( adres.toString() + port ).hashCode(), adres.toString()+";" + port);
    }
    public String removeIzleyici(InetAddress adres, int port) {
        return arrayIzleyici.remove(( adres.toString() + port ).hashCode());        
    }
    
    public void removeIzleyiciAll() {
        arrayIzleyici.clear();
    }
    
    public Iterator<String> getIzleyici(){        
        return  arrayIzleyici.values().iterator();
    }
    
    public Long getUyelikTarih() {
        return uyelikTarih;
    }
    public void setUyelikTarih(Long uyeliktarih) {
        this.uyelikTarih = uyeliktarih;
    }
}
